<?php
/**
 * User: krasen
 * Date: 2015/9/13 21:22
 * Email: jhasheng@hotmail.com
 */
namespace AppBundle\Subscriber;

use AppBundle\Entity\UserEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

class UserSubscriber implements EventSubscriberInterface
{

    /**
     * For instance:
     *
     *  * array('eventName' => 'methodName')
     *  * array('eventName' => array('methodName', $priority))
     *  * array('eventName' => array(array('methodName1', $priority), array('methodName2'))
     *
     * @return array The event names to listen to
     *
     * @api
     */
    public static function getSubscribedEvents()
    {
        return array(
            UserEvent::USER_EVENT_REGSITER => array('onRegisterSuccess', 0)
        );
    }
}